package com.imdroid.udp;

import java.net.DatagramPacket;
import java.util.HashMap;

public class EnsureDeliveryPool {
	
	private static HashMap<String, DatagramPacket> packets = new HashMap<String, DatagramPacket>();
	
	public static void store(DatagramPacket packet, long msgId, short packetId, int receiver){
		packets.put(msgId + "-" + packetId + "-" + receiver, packet);
	}
	
	public static DatagramPacket retrieve(long msgId, short packetId, int receiver){
		return packets.get(msgId + "-" + packetId + "-" + receiver);
	}
	
	public static void removePacket(long msgId, short packetId, int receiver){
		packets.remove(msgId + "-" + packetId + "-" + receiver);
	}

}
